﻿using ELTE.SEM.Data.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ELTE.SEM.Data
{
    public static class LogEntryEx
    {
        public static SEMLogEntryViewModel GetViewModel(this LogEntry entry)
        {
            return new SEMLogEntryViewModel
            {
                Id = entry.Id,
                EntryBegin = entry.EntryBegin,
                EntryEnd = entry.EntryEnd,
                EntryParts = entry.LogEntryParts.Select(ep => ep.GetViewModel()).ToList(),
            };
        }
    }
}
